package com.fs.service.bo.customer;

import com.fs.entity.Customer;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
public class BoCustomer {
    private int id;
    private String name;
    private String wxID;
    private String phone;
    private String token;
    private String avatarUrl;

    public BoCustomer(Customer customer){
        this.id= customer.getId();
        this.name= customer.getName();
        this.phone= customer.getPhone();
        this.wxID= customer.getWxID();
        this.token=customer.getToken();
        this.avatarUrl=customer.getAvatarUrl();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BoCustomer that = (BoCustomer) o;
        return id == that.id &&
                Objects.equals(wxID, that.wxID);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, wxID);
    }
}
